function printCoord(point: { x: number, y: number }): void {
    console.log("The coordinate's x value is " + point.x)
    console.log("The coordinate's y value is " + point.y)
}

printCoord({ x: 3, y: 7 })
// printCoord({ x: "3", y: 7 }) // Error: Argument of type '{ x: string; y: number; }' is not assignable to parameter of type '{ x: number; y: number; }'.


function printName(obj: { first: string, last?: string }): void {
    console.log(obj.first)
}

printName({ first: "Bob" })
printName({ first: "Alice", last: "Zhang" })
// printName({ first: "Alice", last: 0 }) // Error: Argument of type '{ first: string; last: number; }' is not assignable to parameter of type '{ first: string; last?: string; }'.